Package-level declarations

Provides means to implement and apply cryptographic function dependencies.

The module depends on the following cryptographic functions:

  • ChaCha20-Poly1305 Authenticated Encryption with Associated Data (AEAD) from RFC 8439

  • SHA-256 hashing from FIPS 180-4

  • X25519 Diffie-Hellman exchange from RFC 7748

These can be implemented using for example Java SE 11 or Bouncy Castle.

Note that in some cases we speak of “no-op encryption”. This is to meet the EncryptWithAd and DecryptWithAd Noise specification which provide the identity function when no cipher key is set.

Types

Link copied to clipboard
value class AssociatedData(val data: Data)

For use in Authenticated Encryption with Associated Data.

Link copied to clipboard
value class CipherKey(val data: Data)
Link copied to clipboard
value class Ciphertext(val data: Data)

Result of Authenticated Encryption with Associated Data, or of no-op encryption.

Link copied to clipboard
interface Cryptography

Provide the specified algorithm implementations.

Link copied to clipboard
value class Digest(val data: Data)

Outcome of the hashing function.

Link copied to clipboard
value class Nonce(val value: ULong)

An incrementing but non-wrapping number to be used once for encryption.

Link copied to clipboard
value class Plaintext(val data: Data)
Link copied to clipboard
value class PrivateKey(val value: ByteArray)
Link copied to clipboard
value class PublicKey(val data: Data)
Link copied to clipboard
value class SharedSecret(val data: Data)

Outcome of Diffie-Hellman key agreement.